<?php

class TestDAO {
    /**
     * @Resource('pdo')
     */
    private $pdo;

    public function setPdo($pdo) {
        $this->pdo = $pdo;
    }


    public function getFilmList() {
        $pdo = $this->pdo;

        $stm = $pdo->prepare("SELECT * FROM film");
        $stm->execute();

        foreach ($stm->fetchAll() as $film) {
            echo '<li>'.$film['title'].'</li>';
        }
    }
}